﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SnmpForm
{
    public partial class FrmSysConfig : FrmSub
    {
        public FrmSysConfig(MainForm objForm)
            : base(objForm)
        {
            InitializeComponent();
        }

        private void FrmSysConfig_Load(object sender, EventArgs e)
        {
            UInt32 nFaultDetectInterval = Properties.Settings.Default.FaultDetectInterval;
            numericUpDownFaultDetectInterval.Value =
                nFaultDetectInterval;

            ucApIpPoolSet1.Update();
        }

        private void buttonSave_Click(object sender, EventArgs e)
        {
            UInt32 nFaultDetectInterval =
                (uint)numericUpDownFaultDetectInterval.Value;
            Properties.Settings.Default.FaultDetectInterval =
                nFaultDetectInterval;

            if (ucSnmpDefault1.Save())
            {
            }
            else
            {
                return;
            }

            if (ucApIpPoolSet1.Save())
            {
                //重启ApIpPoolTask
                RestartApIpPoolTask();
            }
            else
            {
                return;
            }

            Properties.Settings.Default.Save();

            MessageBox.Show("保存成功");
        }
    }
}
